<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="ui" uri="http://com.am.tag" %>
<%@ include file="../common.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>My JSP 'userList.jsp' starting page</title>
    <script type="text/javascript" src="${path}/js/public/grid.js"></script>
	<script type="text/javascript">
  		
  		function doQuery(){
  			resetGrid(mygrid,"queryForm");
  		}
  		
  		//：0 - 领用 1-出库 2 - 报损 3-退药 4-盘点 5-入库
  		function typeRender(value){
    		if(value == "0"){
    			return "领用";
    		}else if(value == "1"){
    			return "出库";
    		}else if(value == "2"){
    			return "报损";
    		}else if(value == "3"){
    			return "退药";
    		}else if(value == "4"){
    			return "盘点";
    		}
    	}
  		
    	function doReset(){
    		$("#drugName").val("");
    		$("#userName").val("");
    		$("#date1").val("");
    		$("#date2").val("");
    		$("#type").val("");
    	}
  		
	</script>
  </head>
  
  <body>
  
  	<table cellSpacing="0" cellPadding="0" style="width:100%;height:100%;" border="0">
  		<tr id="">
  			<td style="height:35px;width:100%" class="windowHead">	
	  			<form id="queryForm">
					<table cellSpacing="0" cellPadding="0" width="100%" height="100%" border="0"  style="margin-left: 10px;">
						<tr>
							<td class="mywindowTitle">
								<span style="margin-left:10px">药名：</span><input name="search_CONTAIN_name" id="drugName" class="textbox" style="width: 160px" />
								<span style="margin-left:10px;margin-right:0px;">操作人：</span><input name="search_CONTAIN_user_name" id="userName" class="textbox" style="width: 160px" />
								<span style="margin-left:20px;margin-right:20px;"></span><ui:Button onclick="doReset()"><img src="${path}/images/menu/reset.png">重置</ui:Button>
							</td>
						</tr>
						<tr>
							<td class="mywindowTitle">
								<span style="margin-left:10px">时间：</span><ui:DateTimePicker name="startTime" id="date1" dateFormat="yyyy-MM-dd HH:mm:ss" style="width:160px" />
								<span style="margin-left:20px;margin-right:20px;">&gt;&gt;</span>
								<ui:DateTimePicker name="endTime" id="date2" dateFormat="yyyy-MM-dd HH:mm:ss" style="width:160px"/>
								<span style="margin-left:20px;margin-right:20px;"></span><ui:Button type="query" onclick="doQuery()">查询</ui:Button>
							</td>
						</tr>
					</table>
				</form>
				<br/>
				<a style="text-decoration: none;"></a>
			</td>
		</tr>
		
		<tr>
			<td style="width:100%;height:100%;overflow:hidden"  class="windowBody">
				<div id="mess_box" style="width:100%;height:100%;overflow:hidden">
			    	<ui:Grid id="mygrid" css="width:100%;height:100%"
				    		 onCellClicked="selectedSingleRow2"
				    		 dataProvider="com.system.provider.ApproveDetails:getData" parameters='"id":"${param.id}","status":"${param.status}"'>
				    	<ui:GridField name="name" header="药品名称" align="left" width="25%"/>
				    	<ui:GridField name="user_name" header="操作人" align="center" width="13%"/>
				    	<ui:GridField name="quantity" header="数量" align="center" width="10%"/>
				    	<ui:GridField name="type" header="类型" align="center" width="10%" render="typeRender"/>
				    	<ui:GridField name="create_time" header="时间" align="left" width="22%"/>
				    	<ui:GridField name="notes" header="备注" align="center" width="20%"/>
			    	</ui:Grid>
		    	</div>
		    </td>
		</tr>
  	</table>
  </body>
</html>
